#include<stdio.h>
#include<math.h>
/*
pow(3,0) = 1
pow(3,1) = 3
pow(3,2) = 9
pow(3,3) = 27
*/
int main()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i <= n; i++)
    {
        printf("pow(3,%d) = %ld", i, (long int)pow(3.0, i));
        if(i < n)printf("\n");
    }

    return 0;
}